// pages/index/comment/commentList/commentList.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    comments: {
      type: Array,
    },
    isNeedUserComment: {
      type: String,
    },
    splid: {
      type: String,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    defaultAvator:
      'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    delete(e) {
      const { name, id } = e.currentTarget.dataset;
      this.triggerEvent('delete', {
        name,
        id,
      });
    },
    /**
     * 回复用户
     * @param {*} e 
     */
    replyUser(e) {
      const { album_comment_id, name, splid } = e.currentTarget.dataset;
      ;
      this.triggerEvent('reply', { album_comment_id, name, splid }); // 回复成功 刷新列表
    },
    toSetting() {
      wx.navigateTo({
        url: `/pages/index/scene/scene?splid=${this.properties.splid}&type=0`,
      });
    },
  },
});
